package com.xxxy.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.xxxy.blockhandler.MonitorBlockHandler;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
//
@RestController
@RequestMapping("/monitor")
public class MonitroController {
//    @GetMapping("/hello")
//    public String hello() {
//        return "hello ";
//    }
   @SentinelResource(value = "hellResource",blockHandler = "helloBlockHandler",
   blockHandlerClass = MonitorBlockHandler.class)

   @GetMapping("/hello")
    public String hello() {
        return "hello ";
    }

    @GetMapping("/hello2")
    public String hello2() {
        return "hello2 ";
    }
}